﻿using System;
using System.Web;
using System.Web.UI;

namespace Cms.Web.UI.Admin
{
    public partial class PixlrWrapper : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["FrediumAdminLocalization"];
            string localization = cookie != null ? cookie.Value.Substring(0, 2) : "en";
            headerFrame.Attributes.Add("src",
                                       "PixlrBack.aspx?browseitemdata=" +
                                       Server.UrlEncode(Request.QueryString["browseitemdata"]));
            pixlrFrame.Attributes.Add("src",
                                      @"http://www.pixlr.com/editor/?image=" +
                                      Server.UrlEncode(Request.QueryString["image"]) +
                                      "&target=" + Server.UrlEncode(Request.QueryString["target"]) +
                                      "&loc=" + localization);
        }
    }
}